All Questions
6 questions
2votes
2answers
711views
increment a variable date by a month
Is there way on how to increment an input date by one month without using the date -d option? My machine do not have that functionality. Sample: $yearmonth=201912 Expected Output: 201912 202001
1vote
2answers
570views
script with date work on Linux but not on AIX
I wrote a script to that works fine on Linux but fails on AIX 7.2. My script uses the command date with -d. The purpose of this script is to get the last day that is not a Saturday, Sunday or a ...
1vote
2answers
4kviews
Compare two times in HH:MM:SS format - ksh
Is it possible to compare two time (24-hour format)? What I need is to just check if the first time is earlier than the second time. Example: $ ./script.ksh 09:30:15 13:00:34 okay $ ./script.ksh 05:...
9votes
4answers
51kviews
check if date argument is in yyyy-mm-dd format [closed]
Is there a way to check if a date argument is in the correct format (YYYY-MM-DD)? I got this from the web but it doesn't work for me: date "+%Y-%m-%d" -d "2015-10-11" > /dev/null 2>&1 ...
7votes
4answers
15kviews
Calculate date difference between Last modified date of a file and NOW using shell script
I am trying to calculate the time elapsed since the log file was last updated. I guess following commands will be used lastUpdate=$(date -r myLogFile.log) now=$(date) How can I subtract them and get ...
4votes
3answers
44kviews
Convert Month Number to Month Name
is there a way to convert month number to name? example: 2013-10-22 will become Oct 22 I don't have the GNU date and my OS is AIX.